package b面向对象.day3.demo9_随机;

import java.util.Random;

public class RandomTest {
    public static void main1(String[] args) {
        System.out.println(Math.random());//[0,1)
        int m=(int)(Math.random()*100);//[0,100)
        m=(int)(Math.random()*10)+90;//[90,100)
        System.out.println(m);
    }

    public static void main(String[] args) {
        Random r=new Random();
        System.out.println(r.nextInt());//int的范围
        System.out.println(r.nextInt(5));//[0-5)
    }
}
